//
//  UIImage+Extension.m
//  MixDrinks
//
//  Created by admin on 2016/12/27.
//  Copyright © 2016年 Zhongshan Camry Electronic Company Limited. All rights reserved.
//

#import "UIImage+Extension.h"

@implementation UIImage (Extension)
+ (UIImage *)imageWithColor:(UIColor *)color {
    CGFloat imageW = 100 * Width_Scale;
    CGFloat imageH = 100 * Width_Scale;
    //开启图形上下文
    UIGraphicsBeginImageContextWithOptions(CGSizeMake(imageW, imageH), YES, 0.0);
    //画矩形框
    [color set];
    UIRectFill(CGRectMake(0, 0, imageW, imageH));
    //拿到图片,将图片画出来
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    //关闭图形上下文
    UIGraphicsEndImageContext();
    return image;
}
@end
